package com.dong.pointandviewpager.sample.factory

import android.util.Log
import com.dong.pointandviewpager.sample.model.ModelBean
import com.dong.pointviewpager.interfaces.listener.OnLoopPageChangedListener
import com.dong.pointviewpager.interfaces.listener.OnLoopPagerClickListener

/**
 * Created by Dong on 2018/3/20.
 */
object ListenerFactory {

    fun newChangedListener(): OnLoopPageChangedListener {
        return object : OnLoopPageChangedListener {

            override fun onLoopPageSelected(position: Int) {
                Log.i("Dong", "选中Position:$position")
            }

            override fun onLoopPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {}

            override fun onLoopPageScrollStateChanged(state: Int) {}
        }
    }

    fun newClickListener(): OnLoopPagerClickListener<ModelBean>? {
        return object : OnLoopPagerClickListener<ModelBean> {
            override fun onLoopPagerClick(position: Int, bean: ModelBean?) {
                Log.i("Dong", "点击Position:$position")
            }
        }
    }
}